var exec = require('cordova/exec');

var Wechat = {
    login:function(appid, partnerid, onSuccess, onError) {
        exec(
            onSuccess,
            onError,
            "WechatPlugin",
            "login",
            [appid, partnerid]
        );
    },

    share:function(appid, partnerid, url, title, des, isTimeline, onSuccess, onError){
        exec(
            onSuccess,
            onError,
            "WechatPlugin",
            "share",
            [appid, partnerid, url, title, des, isTimeline]
        );
    },

    pay:function(appid, partnerid, prepayid, sign, noncestr, timestamp, onSuccess, onError){
        exec(
            onSuccess,
            onError,
            "WechatPlugin",
            "pay",
            [appid, partnerid, prepayid, sign, noncestr, timestamp]
        );
    }
}

module.exports = Wechat;